<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionController::AbstractRequest</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionController::AbstractRequest</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/actionpack/lib/action_controller/request_rb.html">
                vendor/rails/actionpack/lib/action_controller/request.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
CgiRequest and TestRequest provide concrete implementations.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M001044">accepts</a>&nbsp;&nbsp;
      <a href="#M001077">body</a>&nbsp;&nbsp;
      <a href="#M001053">cache_format</a>&nbsp;&nbsp;
      <a href="#M001042">content_length</a>&nbsp;&nbsp;
      <a href="#M001043">content_type</a>&nbsp;&nbsp;
      <a href="#M001083">content_type_with_parameters</a>&nbsp;&nbsp;
      <a href="#M001084">content_type_without_parameters</a>&nbsp;&nbsp;
      <a href="#M001039">delete?</a>&nbsp;&nbsp;
      <a href="#M001068">domain</a>&nbsp;&nbsp;
      <a href="#M001048">etag_matches?</a>&nbsp;&nbsp;
      <a href="#M001050">format</a>&nbsp;&nbsp;
      <a href="#M001051">format=</a>&nbsp;&nbsp;
      <a href="#M001049">fresh?</a>&nbsp;&nbsp;
      <a href="#M001036">get?</a>&nbsp;&nbsp;
      <a href="#M001040">head?</a>&nbsp;&nbsp;
      <a href="#M001041">headers</a>&nbsp;&nbsp;
      <a href="#M001062">host</a>&nbsp;&nbsp;
      <a href="#M001063">host_with_port</a>&nbsp;&nbsp;
      <a href="#M001045">if_modified_since</a>&nbsp;&nbsp;
      <a href="#M001046">if_none_match</a>&nbsp;&nbsp;
      <a href="#M001035">method</a>&nbsp;&nbsp;
      <a href="#M001047">not_modified?</a>&nbsp;&nbsp;
      <a href="#M001074">parameters</a>&nbsp;&nbsp;
      <a href="#M001072">path</a>&nbsp;&nbsp;
      <a href="#M001076">path_parameters</a>&nbsp;&nbsp;
      <a href="#M001064">port</a>&nbsp;&nbsp;
      <a href="#M001067">port_string</a>&nbsp;&nbsp;
      <a href="#M001037">post?</a>&nbsp;&nbsp;
      <a href="#M001059">protocol</a>&nbsp;&nbsp;
      <a href="#M001038">put?</a>&nbsp;&nbsp;
      <a href="#M001081">query_parameters</a>&nbsp;&nbsp;
      <a href="#M001070">query_string</a>&nbsp;&nbsp;
      <a href="#M001061">raw_host_with_port</a>&nbsp;&nbsp;
      <a href="#M001073">raw_post</a>&nbsp;&nbsp;
      <a href="#M001080">referer</a>&nbsp;&nbsp;
      <a href="#M001079">referrer</a>&nbsp;&nbsp;
      <a href="#M001066">relative_url_root</a>&nbsp;&nbsp;
      <a href="#M001033">relative_url_root=</a>&nbsp;&nbsp;
      <a href="#M001078">remote_addr</a>&nbsp;&nbsp;
      <a href="#M001056">remote_ip</a>&nbsp;&nbsp;
      <a href="#M001034">request_method</a>&nbsp;&nbsp;
      <a href="#M001082">request_parameters</a>&nbsp;&nbsp;
      <a href="#M001071">request_uri</a>&nbsp;&nbsp;
      <a href="#M001057">server_software</a>&nbsp;&nbsp;
      <a href="#M001060">ssl?</a>&nbsp;&nbsp;
      <a href="#M001065">standard_port</a>&nbsp;&nbsp;
      <a href="#M001069">subdomains</a>&nbsp;&nbsp;
      <a href="#M001075">symbolized_path_parameters</a>&nbsp;&nbsp;
      <a href="#M001052">template_format</a>&nbsp;&nbsp;
      <a href="#M001058">url</a>&nbsp;&nbsp;
      <a href="#M001055">xhr?</a>&nbsp;&nbsp;
      <a href="#M001054">xml_http_request?</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">HTTP_METHODS</td>
          <td>=</td>
          <td class="context-item-value">%w(get head put post delete options)</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">HTTP_METHOD_LOOKUP</td>
          <td>=</td>
          <td class="context-item-value">HTTP_METHODS.inject({}) { |h, m| h[m] = h[m.upcase] = m.to_sym;</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">TRUSTED_PROXIES</td>
          <td>=</td>
          <td class="context-item-value">/^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\./i</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
Which IP addresses are &quot;trusted proxies&quot; that can be stripped
from the right-hand-side of X-Forwarded-For

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">MULTIPART_BOUNDARY</td>
          <td>=</td>
          <td class="context-item-value">%r|\Amultipart/form-data.*boundary=\&quot;?([^\&quot;;,]+)\&quot;?|n</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">EOL</td>
          <td>=</td>
          <td class="context-item-value">&quot;\015\012&quot;</td>
        </tr>
        </table>
      </div>
    </div>



    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">env</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
The hash of environment variables for this request, such as {
&#8216;RAILS_ENV&#8217; =&gt; &#8216;production&#8217; }.

</td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M001033" class="method-detail">
        <a name="M001033"></a>

        <div class="method-heading">
          <a href="#M001033" class="method-signature">
          <span class="method-name">relative_url_root=</span><span class="method-args">(relative_url_root)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001033-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001033-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 12</span>
12:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">relative_url_root=</span>(<span class="ruby-identifier">relative_url_root</span>)
13:       <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Deprecation</span>.<span class="ruby-identifier">warn</span>(
14:         <span class="ruby-value str">&quot;ActionController::AbstractRequest.relative_url_root= has been renamed.&quot;</span> <span class="ruby-operator">+</span>
15:         <span class="ruby-value str">&quot;You can now set it with config.action_controller.relative_url_root=&quot;</span>, <span class="ruby-identifier">caller</span>)
16:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">relative_url_root</span>=<span class="ruby-identifier">relative_url_root</span>
17:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M001044" class="method-detail">
        <a name="M001044"></a>

        <div class="method-heading">
          <a href="#M001044" class="method-signature">
          <span class="method-name">accepts</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the accepted MIME type for the request.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001044-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001044-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 93</span>
 93:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accepts</span>
 94:       <span class="ruby-identifier">header</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_ACCEPT'</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>
 95: 
 96:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">header</span>.<span class="ruby-identifier">empty?</span>
 97:         [<span class="ruby-identifier">content_type</span>, <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">ALL</span>].<span class="ruby-identifier">compact</span>
 98:       <span class="ruby-keyword kw">else</span>
 99:         <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">Type</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">header</span>)
100:       <span class="ruby-keyword kw">end</span>
101:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001077" class="method-detail">
        <a name="M001077"></a>

        <div class="method-heading">
          <a href="#M001077" class="method-signature">
          <span class="method-name">body</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The request <a href="AbstractRequest.html#M001077">body</a> is an IO input
stream. If the RAW_POST_DATA environment variable is already set, wrap it
in a StringIO.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001077-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001077-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 427</span>
427:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">body</span>
428:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">raw_post</span> = <span class="ruby-identifier">env</span>[<span class="ruby-value str">'RAW_POST_DATA'</span>]
429:         <span class="ruby-identifier">raw_post</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">BINARY</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">raw_post</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:force_encoding</span>)
430:         <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">raw_post</span>)
431:       <span class="ruby-keyword kw">else</span>
432:         <span class="ruby-identifier">body_stream</span>
433:       <span class="ruby-keyword kw">end</span>
434:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001053" class="method-detail">
        <a name="M001053"></a>

        <div class="method-heading">
          <a href="#M001053" class="method-signature">
          <span class="method-name">cache_format</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001053-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001053-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 189</span>
189:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_format</span>
190:       <span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:format</span>]
191:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001042" class="method-detail">
        <a name="M001042"></a>

        <div class="method-heading">
          <a href="#M001042" class="method-signature">
          <span class="method-name">content_length</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the content length of the request as an integer.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001042-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001042-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 78</span>
78:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_length</span>
79:       <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'CONTENT_LENGTH'</span>].<span class="ruby-identifier">to_i</span>
80:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001043" class="method-detail">
        <a name="M001043"></a>

        <div class="method-heading">
          <a href="#M001043" class="method-signature">
          <span class="method-name">content_type</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The MIME type of the HTTP request, such as Mime::XML.
</p>
<p>
For backward compatibility, the post \<a
href="AbstractRequest.html#M001050">format</a> is extracted from the
X-Post-Data-Format HTTP header if present.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001043-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001043-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 87</span>
87:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_type</span>
88:       <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">Type</span>.<span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">content_type_without_parameters</span>)
89:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001039" class="method-detail">
        <a name="M001039"></a>

        <div class="method-heading">
          <a href="#M001039" class="method-signature">
          <span class="method-name">delete?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Is this a DELETE request? Equivalent to <tt>request.method == :delete</tt>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001039-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001039-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 59</span>
59:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete?</span>
60:       <span class="ruby-identifier">request_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:delete</span>
61:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001068" class="method-detail">
        <a name="M001068"></a>

        <div class="method-heading">
          <a href="#M001068" class="method-signature">
          <span class="method-name">domain</span><span class="method-args">(tld_length = 1)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the \<a href="AbstractRequest.html#M001068">domain</a> part of a
\<a href="AbstractRequest.html#M001062">host</a>, such as
&quot;rubyonrails.org&quot; in &quot;<a
href="http://www.rubyonrails.org">www.rubyonrails.org</a>&quot;. You can
specify a different <tt>tld_length</tt>, such as 2 to catch
rubyonrails.co.uk in &quot;<a
href="http://www.rubyonrails.co.uk">www.rubyonrails.co.uk</a>&quot;.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001068-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001068-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 327</span>
327:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">domain</span>(<span class="ruby-identifier">tld_length</span> = <span class="ruby-value">1</span>)
328:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">named_host?</span>(<span class="ruby-identifier">host</span>)
329: 
330:       <span class="ruby-identifier">host</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'.'</span>).<span class="ruby-identifier">last</span>(<span class="ruby-value">1</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">tld_length</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">'.'</span>)
331:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001048" class="method-detail">
        <a name="M001048"></a>

        <div class="method-heading">
          <a href="#M001048" class="method-signature">
          <span class="method-name">etag_matches?</span><span class="method-args">(etag)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001048-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001048-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 119</span>
119:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">etag_matches?</span>(<span class="ruby-identifier">etag</span>)
120:       <span class="ruby-identifier">if_none_match</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">if_none_match</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">etag</span>
121:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001050" class="method-detail">
        <a name="M001050"></a>

        <div class="method-heading">
          <a href="#M001050" class="method-signature">
          <span class="method-name">format</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="../Mime.html">Mime</a> type for the \<a
href="AbstractRequest.html#M001050">format</a> used in the request.
</p>
<pre>
  GET /posts/5.xml   | request.format =&gt; Mime::XML
  GET /posts/5.xhtml | request.format =&gt; Mime::HTML
  GET /posts/5       | request.format =&gt; Mime::HTML or MIME::JS, or request.accepts.first depending on the value of &lt;tt&gt;ActionController::Base.use_accept_header&lt;/tt&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001050-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001050-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 144</span>
144:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format</span>
145:       <span class="ruby-ivar">@format</span> <span class="ruby-operator">||=</span>
146:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:format</span>]
147:           <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">Type</span>.<span class="ruby-identifier">lookup_by_extension</span>(<span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:format</span>])
148:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">use_accept_header</span>
149:           <span class="ruby-identifier">accepts</span>.<span class="ruby-identifier">first</span>
150:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">xhr?</span>
151:           <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">Type</span>.<span class="ruby-identifier">lookup_by_extension</span>(<span class="ruby-value str">&quot;js&quot;</span>)
152:         <span class="ruby-keyword kw">else</span>
153:           <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">Type</span>.<span class="ruby-identifier">lookup_by_extension</span>(<span class="ruby-value str">&quot;html&quot;</span>)
154:         <span class="ruby-keyword kw">end</span>
155:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001051" class="method-detail">
        <a name="M001051"></a>

        <div class="method-heading">
          <a href="#M001051" class="method-signature">
          <span class="method-name">format=</span><span class="method-args">(extension)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets the \<a href="AbstractRequest.html#M001050">format</a> by string
extension, which can be used to force custom formats that are not
controlled by the extension.
</p>
<pre>
  class ApplicationController &lt; ActionController::Base
    before_filter :adjust_format_for_iphone

    private
      def adjust_format_for_iphone
        request.format = :iphone if request.env[&quot;HTTP_USER_AGENT&quot;][/iPhone/]
      end
  end
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001051-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001051-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 169</span>
169:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format=</span>(<span class="ruby-identifier">extension</span>)
170:       <span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:format</span>] = <span class="ruby-identifier">extension</span>.<span class="ruby-identifier">to_s</span>
171:       <span class="ruby-ivar">@format</span> = <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">Type</span>.<span class="ruby-identifier">lookup_by_extension</span>(<span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:format</span>])
172:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001049" class="method-detail">
        <a name="M001049"></a>

        <div class="method-heading">
          <a href="#M001049" class="method-signature">
          <span class="method-name">fresh?</span><span class="method-args">(response)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Check response freshness (Last-Modified and ETag) against request
If-Modified-Since and If-None-Match conditions. If both <a
href="AbstractRequest.html#M001041">headers</a> are supplied, both must
match, or the request is not considered fresh.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001049-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001049-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 126</span>
126:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fresh?</span>(<span class="ruby-identifier">response</span>)
127:       <span class="ruby-keyword kw">case</span>
128:       <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">if_modified_since</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">if_none_match</span> 
129:         <span class="ruby-identifier">not_modified?</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">last_modified</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">etag_matches?</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">etag</span>) 
130:       <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">if_modified_since</span> 
131:         <span class="ruby-identifier">not_modified?</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">last_modified</span>) 
132:       <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">if_none_match</span> 
133:         <span class="ruby-identifier">etag_matches?</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">etag</span>) 
134:       <span class="ruby-keyword kw">else</span> 
135:         <span class="ruby-keyword kw">false</span> 
136:       <span class="ruby-keyword kw">end</span> 
137:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001036" class="method-detail">
        <a name="M001036"></a>

        <div class="method-heading">
          <a href="#M001036" class="method-signature">
          <span class="method-name">get?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Is this a GET (or HEAD) request? Equivalent to <tt>request.method ==
:get</tt>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001036-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001036-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 44</span>
44:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get?</span>
45:       <span class="ruby-identifier">method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:get</span>
46:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001040" class="method-detail">
        <a name="M001040"></a>

        <div class="method-heading">
          <a href="#M001040" class="method-signature">
          <span class="method-name">head?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Is this a HEAD request? Since <tt>request.method</tt> sees HEAD as
<tt>:get</tt>, this \<a href="AbstractRequest.html#M001035">method</a>
checks the actual HTTP \<a href="AbstractRequest.html#M001035">method</a>
directly.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001040-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001040-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 65</span>
65:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">head?</span>
66:       <span class="ruby-identifier">request_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:head</span>
67:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001041" class="method-detail">
        <a name="M001041"></a>

        <div class="method-heading">
          <a href="#M001041" class="method-signature">
          <span class="method-name">headers</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Provides access to the request&#8216;s HTTP <a
href="AbstractRequest.html#M001041">headers</a>, for example:
</p>
<pre>
  request.headers[&quot;Content-Type&quot;] # =&gt; &quot;text/plain&quot;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001041-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001041-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 72</span>
72:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">headers</span>
73:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Http</span><span class="ruby-operator">::</span><span class="ruby-constant">Headers</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@env</span>)
74:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001062" class="method-detail">
        <a name="M001062"></a>

        <div class="method-heading">
          <a href="#M001062" class="method-signature">
          <span class="method-name">host</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="AbstractRequest.html#M001062">host</a> for this
request, such as example.com.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001062-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001062-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 280</span>
280:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host</span>
281:       <span class="ruby-identifier">raw_host_with_port</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/:\d+$/</span>, <span class="ruby-value str">''</span>)
282:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001063" class="method-detail">
        <a name="M001063"></a>

        <div class="method-heading">
          <a href="#M001063" class="method-signature">
          <span class="method-name">host_with_port</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a \<a href="AbstractRequest.html#M001062">host</a>:\<a
href="AbstractRequest.html#M001064">port</a> string for this request, such
as &quot;example.com&quot; or &quot;example.com:8080&quot;.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001063-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001063-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 287</span>
287:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host_with_port</span>
288:       <span class="ruby-node">&quot;#{host}#{port_string}&quot;</span>
289:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001045" class="method-detail">
        <a name="M001045"></a>

        <div class="method-heading">
          <a href="#M001045" class="method-signature">
          <span class="method-name">if_modified_since</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001045-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001045-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 104</span>
104:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">if_modified_since</span>
105:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">since</span> = <span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_IF_MODIFIED_SINCE'</span>]
106:         <span class="ruby-constant">Time</span>.<span class="ruby-identifier">rfc2822</span>(<span class="ruby-identifier">since</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
107:       <span class="ruby-keyword kw">end</span>
108:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001046" class="method-detail">
        <a name="M001046"></a>

        <div class="method-heading">
          <a href="#M001046" class="method-signature">
          <span class="method-name">if_none_match</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001046-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001046-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 111</span>
111:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">if_none_match</span>
112:       <span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_IF_NONE_MATCH'</span>]
113:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001035" class="method-detail">
        <a name="M001035"></a>

        <div class="method-heading">
          <a href="#M001035" class="method-signature">
          <span class="method-name">method</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The HTTP request \<a href="AbstractRequest.html#M001035">method</a> as a
lowercase symbol, such as <tt>:get</tt>. Note, HEAD is returned as
<tt>:get</tt> since the two are functionally equivalent from the
application&#8216;s perspective.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001035-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001035-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 39</span>
39:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method</span>
40:       <span class="ruby-identifier">request_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:head</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">:get</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">request_method</span>
41:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001047" class="method-detail">
        <a name="M001047"></a>

        <div class="method-heading">
          <a href="#M001047" class="method-signature">
          <span class="method-name">not_modified?</span><span class="method-args">(modified_at)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001047-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001047-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 115</span>
115:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">not_modified?</span>(<span class="ruby-identifier">modified_at</span>)
116:       <span class="ruby-identifier">if_modified_since</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modified_at</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">if_modified_since</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">modified_at</span>
117:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001074" class="method-detail">
        <a name="M001074"></a>

        <div class="method-heading">
          <a href="#M001074" class="method-signature">
          <span class="method-name">parameters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns both GET and POST \<a
href="AbstractRequest.html#M001074">parameters</a> in a single hash.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001074-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001074-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 401</span>
401:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parameters</span>
402:       <span class="ruby-ivar">@parameters</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">request_parameters</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">query_parameters</span>).<span class="ruby-identifier">update</span>(<span class="ruby-identifier">path_parameters</span>).<span class="ruby-identifier">with_indifferent_access</span>
403:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001072" class="method-detail">
        <a name="M001072"></a>

        <div class="method-heading">
          <a href="#M001072" class="method-signature">
          <span class="method-name">path</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the interpreted \<a href="AbstractRequest.html#M001072">path</a> to
requested resource after all the installation directory of this application
was taken into account.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001072-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001072-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 381</span>
381:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>
382:       <span class="ruby-identifier">path</span> = (<span class="ruby-identifier">uri</span> = <span class="ruby-identifier">request_uri</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'?'</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">:</span> <span class="ruby-value str">''</span>
383: 
384:       <span class="ruby-comment cmt"># Cut off the path to the installation directory if given</span>
385:       <span class="ruby-identifier">path</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-node">%r/^#{ActionController::Base.relative_url_root}/</span>, <span class="ruby-value str">''</span>)
386:       <span class="ruby-identifier">path</span> <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>
387:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001076" class="method-detail">
        <a name="M001076"></a>

        <div class="method-heading">
          <a href="#M001076" class="method-signature">
          <span class="method-name">path_parameters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a hash with the \<a
href="AbstractRequest.html#M001074">parameters</a> used to form the \<a
href="AbstractRequest.html#M001072">path</a> of the request. Returned hash
keys are strings:
</p>
<pre>
  {'action' =&gt; 'my_action', 'controller' =&gt; 'my_controller'}
</pre>
<p>
See <tt><a
href="AbstractRequest.html#M001075">symbolized_path_parameters</a></tt> for
symbolized keys.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001076-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001076-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 421</span>
421:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path_parameters</span>
422:       <span class="ruby-ivar">@path_parameters</span> <span class="ruby-operator">||=</span> {}
423:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001064" class="method-detail">
        <a name="M001064"></a>

        <div class="method-heading">
          <a href="#M001064" class="method-signature">
          <span class="method-name">port</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the <a href="AbstractRequest.html#M001064">port</a> number of this
request as an integer.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001064-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001064-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 293</span>
293:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">port</span>
294:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">raw_host_with_port</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/:(\d+)$/</span>
295:         <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">to_i</span>
296:       <span class="ruby-keyword kw">else</span>
297:         <span class="ruby-identifier">standard_port</span>
298:       <span class="ruby-keyword kw">end</span>
299:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001067" class="method-detail">
        <a name="M001067"></a>

        <div class="method-heading">
          <a href="#M001067" class="method-signature">
          <span class="method-name">port_string</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a \<a href="AbstractRequest.html#M001064">port</a> suffix like
&quot;:8080&quot; if the \<a href="AbstractRequest.html#M001064">port</a>
number of this request is not the default HTTP \<a
href="AbstractRequest.html#M001064">port</a> 80 or HTTPS \<a
href="AbstractRequest.html#M001064">port</a> 443.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001067-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001067-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 321</span>
321:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">port_string</span>
322:       <span class="ruby-identifier">port</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">standard_port</span> <span class="ruby-value">? </span><span class="ruby-value str">''</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;:#{port}&quot;</span>
323:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001037" class="method-detail">
        <a name="M001037"></a>

        <div class="method-heading">
          <a href="#M001037" class="method-signature">
          <span class="method-name">post?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Is this a POST request? Equivalent to <tt>request.method == :post</tt>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001037-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001037-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 49</span>
49:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post?</span>
50:       <span class="ruby-identifier">request_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:post</span>
51:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001059" class="method-detail">
        <a name="M001059"></a>

        <div class="method-heading">
          <a href="#M001059" class="method-signature">
          <span class="method-name">protocol</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns &#8216;https://&#8217; if this is an SSL request and
&#8216;http://&#8217; otherwise.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001059-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001059-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 260</span>
260:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">protocol</span>
261:       <span class="ruby-identifier">ssl?</span> <span class="ruby-value">? </span><span class="ruby-value str">'https://'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'http://'</span>
262:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001038" class="method-detail">
        <a name="M001038"></a>

        <div class="method-heading">
          <a href="#M001038" class="method-signature">
          <span class="method-name">put?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Is this a PUT request? Equivalent to <tt>request.method == :put</tt>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001038-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001038-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 54</span>
54:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put?</span>
55:       <span class="ruby-identifier">request_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:put</span>
56:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001081" class="method-detail">
        <a name="M001081"></a>

        <div class="method-heading">
          <a href="#M001081" class="method-signature">
          <span class="method-name">query_parameters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001081-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001081-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 446</span>
446:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query_parameters</span>
447:       <span class="ruby-ivar">@query_parameters</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">parse_query_parameters</span>(<span class="ruby-identifier">query_string</span>)
448:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001070" class="method-detail">
        <a name="M001070"></a>

        <div class="method-heading">
          <a href="#M001070" class="method-signature">
          <span class="method-name">query_string</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the query string, accounting for server idiosyncrasies.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001070-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001070-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 344</span>
344:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query_string</span>
345:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REQUEST_URI'</span>]
346:         <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'?'</span>, <span class="ruby-value">2</span>)[<span class="ruby-value">1</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>
347:       <span class="ruby-keyword kw">else</span>
348:         <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'QUERY_STRING'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>
349:       <span class="ruby-keyword kw">end</span>
350:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001061" class="method-detail">
        <a name="M001061"></a>

        <div class="method-heading">
          <a href="#M001061" class="method-signature">
          <span class="method-name">raw_host_with_port</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the \<a href="AbstractRequest.html#M001062">host</a> for this
request, such as &quot;example.com&quot;.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001061-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001061-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 271</span>
271:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raw_host_with_port</span>
272:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">forwarded</span> = <span class="ruby-identifier">env</span>[<span class="ruby-value str">&quot;HTTP_X_FORWARDED_HOST&quot;</span>]
273:         <span class="ruby-identifier">forwarded</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/,\s?/</span>).<span class="ruby-identifier">last</span>
274:       <span class="ruby-keyword kw">else</span>
275:         <span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_HOST'</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-value str">'SERVER_NAME'</span>] <span class="ruby-operator">||</span> <span class="ruby-node">&quot;#{env['SERVER_ADDR']}:#{env['SERVER_PORT']}&quot;</span>
276:       <span class="ruby-keyword kw">end</span>
277:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001073" class="method-detail">
        <a name="M001073"></a>

        <div class="method-heading">
          <a href="#M001073" class="method-signature">
          <span class="method-name">raw_post</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Read the request \<a href="AbstractRequest.html#M001077">body</a>. This is
useful for web services that need to work with raw requests directly.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001073-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001073-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 392</span>
392:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raw_post</span>
393:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">env</span>.<span class="ruby-identifier">include?</span> <span class="ruby-value str">'RAW_POST_DATA'</span>
394:         <span class="ruby-identifier">env</span>[<span class="ruby-value str">'RAW_POST_DATA'</span>] = <span class="ruby-identifier">body</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">content_length</span>)
395:         <span class="ruby-identifier">body</span>.<span class="ruby-identifier">rewind</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:rewind</span>)
396:       <span class="ruby-keyword kw">end</span>
397:       <span class="ruby-identifier">env</span>[<span class="ruby-value str">'RAW_POST_DATA'</span>]
398:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001080" class="method-detail">
        <a name="M001080"></a>

        <div class="method-heading">
          <span class="method-name">referer</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="AbstractRequest.html#M001079">referrer</a>
</p>
        </div>
      </div>

      <div id="method-M001079" class="method-detail">
        <a name="M001079"></a>

        <div class="method-heading">
          <a href="#M001079" class="method-signature">
          <span class="method-name">referrer</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001079-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001079-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 440</span>
440:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">referrer</span>
441:       <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_REFERER'</span>]
442:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001066" class="method-detail">
        <a name="M001066"></a>

        <div class="method-heading">
          <a href="#M001066" class="method-signature">
          <span class="method-name">relative_url_root</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the value of ActionController::Base.relative_url_root. This <a
href="AbstractRequest.html#M001035">method</a> is deprecated as the value
is an application wide setting, not something which changes per request.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001066-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001066-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 313</span>
313:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">relative_url_root</span>
314:       <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Deprecation</span>.<span class="ruby-identifier">warn</span>(
315:         <span class="ruby-value str">&quot;relative_url_root is now set application-wide, use ActionController::Base.relative_url_root instead.&quot;</span>, <span class="ruby-identifier">caller</span>)
316:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">relative_url_root</span>
317:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001078" class="method-detail">
        <a name="M001078"></a>

        <div class="method-heading">
          <a href="#M001078" class="method-signature">
          <span class="method-name">remote_addr</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001078-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001078-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 436</span>
436:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remote_addr</span>
437:       <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REMOTE_ADDR'</span>]
438:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001056" class="method-detail">
        <a name="M001056"></a>

        <div class="method-heading">
          <a href="#M001056" class="method-signature">
          <span class="method-name">remote_ip</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Determines originating IP address. REMOTE_ADDR is the standard but will
fail if the user is behind a proxy. HTTP_CLIENT_IP and/or
HTTP_X_FORWARDED_FOR are set by proxies so check for these if REMOTE_ADDR
is a proxy. HTTP_X_FORWARDED_FOR may be a comma- delimited list in the case
of multiple chained proxies; the last address which is not trusted is the
originating IP.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001056-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001056-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 211</span>
211:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remote_ip</span>
212:       <span class="ruby-identifier">remote_addr_list</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REMOTE_ADDR'</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REMOTE_ADDR'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">collect</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">:strip</span>)
213: 
214:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">remote_addr_list</span>.<span class="ruby-identifier">blank?</span>
215:         <span class="ruby-identifier">not_trusted_addrs</span> = <span class="ruby-identifier">remote_addr_list</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">addr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">addr</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">TRUSTED_PROXIES</span>}
216:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">not_trusted_addrs</span>.<span class="ruby-identifier">first</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">not_trusted_addrs</span>.<span class="ruby-identifier">empty?</span>
217:       <span class="ruby-keyword kw">end</span>
218:       <span class="ruby-identifier">remote_ips</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_X_FORWARDED_FOR'</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_X_FORWARDED_FOR'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>)
219: 
220:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@env</span>.<span class="ruby-identifier">include?</span> <span class="ruby-value str">'HTTP_CLIENT_IP'</span>
221:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">remote_ips</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">remote_ips</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_CLIENT_IP'</span>])
222:           <span class="ruby-comment cmt"># We don't know which came from the proxy, and which from the user</span>
223:           <span class="ruby-identifier">raise</span> <span class="ruby-constant">ActionControllerError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;IP spoofing attack?!\nHTTP_CLIENT_IP=\#{@env['HTTP_CLIENT_IP'].inspect}\nHTTP_X_FORWARDED_FOR=\#{@env['HTTP_X_FORWARDED_FOR'].inspect}\n&quot;</span>)
224:         <span class="ruby-keyword kw">end</span>
225: 
226:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_CLIENT_IP'</span>]
227:       <span class="ruby-keyword kw">end</span>
228: 
229:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">remote_ips</span>
230:         <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">remote_ips</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">TRUSTED_PROXIES</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">remote_ips</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">strip</span>
231:           <span class="ruby-identifier">remote_ips</span>.<span class="ruby-identifier">pop</span>
232:         <span class="ruby-keyword kw">end</span>
233: 
234:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">remote_ips</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">strip</span>
235:       <span class="ruby-keyword kw">end</span>
236: 
237:       <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REMOTE_ADDR'</span>]
238:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001034" class="method-detail">
        <a name="M001034"></a>

        <div class="method-heading">
          <a href="#M001034" class="method-signature">
          <span class="method-name">request_method</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The true HTTP request \<a href="AbstractRequest.html#M001035">method</a> as
a lowercase symbol, such as <tt>:get</tt>. UnknownHttpMethod is raised for
invalid methods not listed in ACCEPTED_HTTP_METHODS.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001034-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001034-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 28</span>
28:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_method</span>
29:       <span class="ruby-identifier">method</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REQUEST_METHOD'</span>]
30:       <span class="ruby-identifier">method</span> = <span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:_method</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'POST'</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:_method</span>].<span class="ruby-identifier">blank?</span>
31: 
32:       <span class="ruby-constant">HTTP_METHOD_LOOKUP</span>[<span class="ruby-identifier">method</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">raise</span>(<span class="ruby-constant">UnknownHttpMethod</span>, <span class="ruby-node">&quot;#{method}, accepted HTTP methods are #{HTTP_METHODS.to_sentence}&quot;</span>)
33:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001082" class="method-detail">
        <a name="M001082"></a>

        <div class="method-heading">
          <a href="#M001082" class="method-signature">
          <span class="method-name">request_parameters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001082-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001082-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 450</span>
450:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_parameters</span>
451:       <span class="ruby-ivar">@request_parameters</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">parse_formatted_request_parameters</span>
452:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001071" class="method-detail">
        <a name="M001071"></a>

        <div class="method-heading">
          <a href="#M001071" class="method-signature">
          <span class="method-name">request_uri</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the request URI, accounting for server idiosyncrasies. WEBrick
includes the full URL. IIS leaves REQUEST_URI blank.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001071-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001071-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 355</span>
355:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_uri</span>
356:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REQUEST_URI'</span>]
357:         <span class="ruby-comment cmt"># Remove domain, which webrick puts into the request_uri.</span>
358:         (<span class="ruby-regexp re">%r{^\w+\://[^/]+(/.*|$)$}</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">uri</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">$1</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">uri</span>
359:       <span class="ruby-keyword kw">else</span>
360:         <span class="ruby-comment cmt"># Construct IIS missing REQUEST_URI from SCRIPT_NAME and PATH_INFO.</span>
361:         <span class="ruby-identifier">uri</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'PATH_INFO'</span>].<span class="ruby-identifier">to_s</span>
362: 
363:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">script_filename</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'SCRIPT_NAME'</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">%r{[^/]+$}</span>)
364:           <span class="ruby-identifier">uri</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-node">/#{script_filename}\//</span>, <span class="ruby-value str">''</span>)
365:         <span class="ruby-keyword kw">end</span>
366: 
367:         <span class="ruby-identifier">env_qs</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'QUERY_STRING'</span>].<span class="ruby-identifier">to_s</span>
368:         <span class="ruby-identifier">uri</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;?#{env_qs}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">env_qs</span>.<span class="ruby-identifier">empty?</span>
369: 
370:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">blank?</span>
371:           <span class="ruby-ivar">@env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'REQUEST_URI'</span>)
372:         <span class="ruby-keyword kw">else</span>
373:           <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REQUEST_URI'</span>] = <span class="ruby-identifier">uri</span>
374:         <span class="ruby-keyword kw">end</span>
375:       <span class="ruby-keyword kw">end</span>
376:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001057" class="method-detail">
        <a name="M001057"></a>

        <div class="method-heading">
          <a href="#M001057" class="method-signature">
          <span class="method-name">server_software</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the lowercase name of the HTTP server software.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001057-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001057-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 247</span>
247:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server_software</span>
248:       (<span class="ruby-ivar">@env</span>[<span class="ruby-value str">'SERVER_SOFTWARE'</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-regexp re">/^([a-zA-Z]+)/</span> <span class="ruby-operator">=~</span> <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'SERVER_SOFTWARE'</span>]) <span class="ruby-operator">?</span> <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
249:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001060" class="method-detail">
        <a name="M001060"></a>

        <div class="method-heading">
          <a href="#M001060" class="method-signature">
          <span class="method-name">ssl?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Is this an SSL request?
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001060-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001060-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 266</span>
266:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ssl?</span>
267:       <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTPS'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'on'</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_X_FORWARDED_PROTO'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'https'</span>
268:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001065" class="method-detail">
        <a name="M001065"></a>

        <div class="method-heading">
          <a href="#M001065" class="method-signature">
          <span class="method-name">standard_port</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the standard \<a href="AbstractRequest.html#M001064">port</a>
number for this request&#8216;s <a
href="AbstractRequest.html#M001059">protocol</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001065-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001065-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 303</span>
303:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">standard_port</span>
304:       <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">protocol</span>
305:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'https://'</span> <span class="ruby-keyword kw">then</span> <span class="ruby-value">443</span>
306:         <span class="ruby-keyword kw">else</span> <span class="ruby-value">80</span>
307:       <span class="ruby-keyword kw">end</span>
308:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001069" class="method-detail">
        <a name="M001069"></a>

        <div class="method-heading">
          <a href="#M001069" class="method-signature">
          <span class="method-name">subdomains</span><span class="method-args">(tld_length = 1)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns all the \<a href="AbstractRequest.html#M001069">subdomains</a> as
an array, so <tt>[&quot;dev&quot;, &quot;www&quot;]</tt> would be returned
for &quot;dev.www.rubyonrails.org&quot;. You can specify a different
<tt>tld_length</tt>, such as 2 to catch <tt>[&quot;www&quot;]</tt> instead
of <tt>[&quot;www&quot;, &quot;rubyonrails&quot;]</tt> in &quot;<a
href="http://www.rubyonrails.co.uk">www.rubyonrails.co.uk</a>&quot;.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001069-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001069-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 337</span>
337:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">subdomains</span>(<span class="ruby-identifier">tld_length</span> = <span class="ruby-value">1</span>)
338:       <span class="ruby-keyword kw">return</span> [] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">named_host?</span>(<span class="ruby-identifier">host</span>)
339:       <span class="ruby-identifier">parts</span> = <span class="ruby-identifier">host</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'.'</span>)
340:       <span class="ruby-identifier">parts</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-operator">-</span>(<span class="ruby-identifier">tld_length</span><span class="ruby-operator">+</span><span class="ruby-value">2</span>)]
341:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001075" class="method-detail">
        <a name="M001075"></a>

        <div class="method-heading">
          <a href="#M001075" class="method-signature">
          <span class="method-name">symbolized_path_parameters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The same as <tt><a
href="AbstractRequest.html#M001076">path_parameters</a></tt> with
explicitly symbolized keys.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001075-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001075-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 411</span>
411:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">symbolized_path_parameters</span>
412:       <span class="ruby-ivar">@symbolized_path_parameters</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">path_parameters</span>.<span class="ruby-identifier">symbolize_keys</span>
413:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001052" class="method-detail">
        <a name="M001052"></a>

        <div class="method-heading">
          <a href="#M001052" class="method-signature">
          <span class="method-name">template_format</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a symbolized version of the <tt>:<a
href="AbstractRequest.html#M001050">format</a></tt> parameter of the
request. If no \<a href="AbstractRequest.html#M001050">format</a> is given
it returns <tt>:js</tt>for Ajax requests and <tt>:html</tt> otherwise.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001052-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001052-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 177</span>
177:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">template_format</span>
178:       <span class="ruby-identifier">parameter_format</span> = <span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:format</span>]
179: 
180:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parameter_format</span>
181:         <span class="ruby-identifier">parameter_format</span>
182:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">xhr?</span>
183:         <span class="ruby-identifier">:js</span>
184:       <span class="ruby-keyword kw">else</span>
185:         <span class="ruby-identifier">:html</span>
186:       <span class="ruby-keyword kw">end</span>
187:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001058" class="method-detail">
        <a name="M001058"></a>

        <div class="method-heading">
          <a href="#M001058" class="method-signature">
          <span class="method-name">url</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the complete URL used for this request.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001058-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001058-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 254</span>
254:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url</span>
255:       <span class="ruby-identifier">protocol</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">host_with_port</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">request_uri</span>
256:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001055" class="method-detail">
        <a name="M001055"></a>

        <div class="method-heading">
          <span class="method-name">xhr?</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for xml_http_request?
</p>
        </div>
      </div>

      <div id="method-M001054" class="method-detail">
        <a name="M001054"></a>

        <div class="method-heading">
          <a href="#M001054" class="method-signature">
          <span class="method-name">xml_http_request?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns true if the request&#8216;s &quot;X-Requested-With&quot; header
contains &quot;XMLHttpRequest&quot;. (The Prototype Javascript library
sends this header with every Ajax request.)
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001054-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001054-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 196</span>
196:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">xml_http_request?</span>
197:       <span class="ruby-operator">!</span>(<span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_X_REQUESTED_WITH'</span>] <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/XMLHttpRequest/i</span>)
198:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M001083" class="method-detail">
        <a name="M001083"></a>

        <div class="method-heading">
          <a href="#M001083" class="method-signature">
          <span class="method-name">content_type_with_parameters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The raw content type string. Use when you need <a
href="AbstractRequest.html#M001074">parameters</a> such as charset or
boundary which aren&#8216;t included in the <a
href="AbstractRequest.html#M001043">content_type</a> MIME type. Overridden
by the X-POST_DATA_FORMAT header for backward compatibility.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001083-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001083-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 479</span>
479:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_type_with_parameters</span>
480:         <span class="ruby-identifier">content_type_from_legacy_post_data_format_header</span> <span class="ruby-operator">||</span>
481:           <span class="ruby-identifier">env</span>[<span class="ruby-value str">'CONTENT_TYPE'</span>].<span class="ruby-identifier">to_s</span>
482:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001084" class="method-detail">
        <a name="M001084"></a>

        <div class="method-heading">
          <a href="#M001084" class="method-signature">
          <span class="method-name">content_type_without_parameters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
The raw content type string with its <a
href="AbstractRequest.html#M001074">parameters</a> stripped off.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001084-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001084-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/request.rb, line 485</span>
485:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_type_without_parameters</span>
486:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">extract_content_type_without_parameters</span>(<span class="ruby-identifier">content_type_with_parameters</span>)
487:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>